package com.crm.mapper;

import com.crm.vo.BaseInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.time.LocalDate;

@Mapper
public interface IndexMapper {
    @Select("select count(*) from clue where createTime >= #{beginCreateTime} and createTime <= #{endCreateTime} and transfer = 0")
    Integer getClueJC(LocalDate beginCreateTime, LocalDate endCreateTime);//查询线索数量
    @Select("select count(*) from business where create_time >= #{beginCreateTime} and create_time <= #{endCreateTime}")
    Integer getBusinessJC(LocalDate beginCreateTime, LocalDate endCreateTime);//查询线索数量
    @Select("select count(*) from business where create_time >= #{beginCreateTime} and create_time <= #{endCreateTime} and contract_type = 1")
    Integer getBusinessContract(LocalDate beginCreateTime, LocalDate endCreateTime);


    @Select("select count(*) from clue where createTime >= #{beginCreateTime} and createTime <= #{endCreateTime} and transfer = 0")
    Integer getSumClue(LocalDate beginCreateTime, LocalDate endCreateTime);//线索数
    @Select("select count(*) from clue where createTime >= #{beginCreateTime} and createTime <= #{endCreateTime} and faketype = 0 and transfer = 0")
    Integer getYESClue(LocalDate beginCreateTime, LocalDate endCreateTime);//有效线索数
    @Select("select count(*) from business where create_time >= #{beginCreateTime} and create_Time <= #{endCreateTime}")
    Integer getBusiness(LocalDate beginCreateTime, LocalDate endCreateTime);//商机数
    @Select("select count(*) from business where create_time >= #{beginCreateTime} and create_time <= #{endCreateTime} and contract_type = 1")
    Integer getContract(LocalDate beginCreateTime, LocalDate endCreateTime);//转为客户数


}
